home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech's Sprocket™ / Sprocket (original from 1994) / ReadMe-Sprocket for Symantec < prev    next >
Encoding:
Text File  |  1994-12-19  |  3.5 KB  |  101 lines  |  [TEXT/ttxt]

  1. Dec. 18, 1994
  2.  
  3. Dave Falkenburg is the keeper of Sprocket.  His code is the official Sprocket.
  4. Dave Falkenburg is not developing Sprocket in Symantec C++, though he is
  5. maintaining any code changes to make Sprocket Symantec compatible.
  6.  
  7. In order to compile the latest Sprocket, I (the Editorial Assistant) had to
  8. make a couple of changes to the code. These changes are minor and have 
  9. been detailed below.  They have been submitted to Mr. Falkenburg, but he has
  10. not yet released a newer version with the changes rolled in.
  11.  
  12. Have fun!
  13.  
  14. John Kawakami
  15. Editorial Assistant
  16. MacTech Magazine
  17. ------------------------------------------------------------------
  18.  
  19. Please forward as appropriate.
  20.  
  21. I'm using SC++ 7.0 to compile Sprocket and have run into the same problems I encountered when I porting Threaded Sprocket.  I was using SC++ 7.0, the version of the Apple Universal Headers as of Nov. 1994, and CodeWarrior Gold as of July 1994. (I went ahead and deleted traces of the old sprocket and the new universal headers before compiling.  I think it was all gone when I did this.)
  22.  
  23. Steps:
  24.  
  25. 1. Copy into the Symantec Universal Headers folder, from the latest Universal Headers: Drag.h, Threads.h, GestaltEqu.h, Gestalt.h, the AOCE folder, the QuickDraw GX folder.
  26.  
  27. 2. Drag the file Sprocket into the Sprocket Sample folder if it's not there already.
  28.  
  29. 3. Make an alias to the Sprocket Sample folder, and drag it into the Aliases folder in the Symantec C++ folder.
  30.  
  31. 4. Read the following, make the changes, and it will compile.
  32.  
  33. I get a compile error:
  34.  
  35. File “Sprocket.h”; Line 136: extern FrontWindowUPP    FrontWindowProcForAOCEUPP;
  36.  
  37. I also get an error in Window.cp that dragNotAcceptedErr is undefined.
  38. This error happens because Symantec and Apple and MetroWorks ship
  39. different Universal Headers!  MetroWorks ships some headers that have
  40. not been rolled into the Universal Headers as of November 1994.
  41.  
  42. I dealt with this problem by copying the following lines from the MetroWorks headers.  The first part is from Drag.h, the second part is from the AOCE headers (don't remember exactly which).
  43.  
  44. #ifdef __SC__
  45. enum  {
  46.     badDragRefErr                = -1850,
  47.     badDragItemErr                = -1851,
  48.     badDragFlavorErr            = -1852,
  49.     duplicateFlavorErr            = -1853,
  50.     cantGetFlavorErr            = -1854,
  51.     duplicateHandlerErr            = -1855,
  52.     handlerNotFoundErr            = -1856,
  53.     dragNotAcceptedErr            = -1857
  54. };
  55.  
  56. typedef UniversalProcPtr FrontWindowUPP;
  57.  
  58. #define CallFrontWindowProc(userRoutine, clientData)        \
  59.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppFrontWindowProcInfo, (clientData))
  60. #define NewFrontWindowProc(userRoutine)        \
  61.         (FrontWindowUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppFrontWindowProcInfo, GetCurrentISA())
  62. #else
  63. typedef FrontWindowProcPtr FrontWindowUPP;
  64.  
  65. #define CallFrontWindowProc(userRoutine, clientData)        \
  66.         (*(userRoutine))((clientData))
  67. #define NewFrontWindowProc(userRoutine)        \
  68.         (FrontWindowUPP)(userRoutine)
  69. #endif
  70.  
  71. ---------------------
  72.  
  73. The following code fixes the problem with the dialog box.  
  74. The original code didn't check the value of GetStdFilterProc.
  75. Perhaps it runs fine on some systems without the check, but
  76. it poops on mine.
  77.  
  78. #ifndef    powerc
  79. #ifdef    __SC__
  80.  
  81. extern pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  82.  THREEWORDINLINE(0x303C, 0x0203, 0xAA68);
  83.  
  84. pascal Boolean
  85. StdFilterProc(DialogPtr theDialog, EventRecord* anEvent, short* itemHit)
  86.     {
  87.     ModalFilterUPP    filterUPP;
  88.     OSErr            myErr;
  89.     Boolean            returnVal = false;
  90.     
  91.     //    Dialogs.h
  92.     
  93.     myErr = GetStdFilterProc(&filterUPP);
  94.     if (!myErr) returnVal = CallModalFilterProc(filterUPP,theDialog,anEvent,itemHit);
  95.     
  96.     return    returnVal;
  97.     }
  98.  
  99. #endif
  100. #endif
  101.